package org.blogwu.learn.multithread.chapter3.demo22;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;

import java.util.Date;
import java.util.concurrent.ArrayBlockingQueue;

public class Main {

    public static ArrayBlockingQueue<String> arrayBlockingQueue = new ArrayBlockingQueue(5);

    public static Object obj = new Object();

    public static void main(String[] args) throws InterruptedException {
//
//        for (int i = 0; i < 8; i++) {
//            System.out.println( arrayBlockingQueue.offer("值："+i));
//        }
//        System.out.println("offer over");

//        Producer pro = new Producer();
//        Consumer con = new Consumer();
//
//        pro.start();
//        con.start();

//
//        Date now = DateUtil.date();
//        Date beginOfMonth = DateUtil.beginOfMonth(now);
//        Date endOfMonth = DateUtil.endOfMonth(now);
//        System.out.println(beginOfMonth);
//        System.out.println(endOfMonth);

        String dateStr = "2017-03-02 22:33:23";
        Date date = DateUtil.parse(dateStr);
        Date yesterday = DateUtil.offset(date, DateField.DAY_OF_MONTH, -1);
        System.out.println(yesterday);


    }
}
